
using Microsoft.EntityFrameworkCore;
using System;

namespace ShoppingCenter.Backend.Api.Model
{
    public static class SeedData
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {
            var currentData = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            //初始化管理员
            modelBuilder.Entity<Admin>().HasData(
                new Admin
                {
                    Id = 1,
                    Name = "admin",
                    Password = "123",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化用户
            modelBuilder.Entity<User>().HasData(
                new User
                {
                    Id = 1,
                    Name = "uu",
                    Password = "123",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化用户详情
            modelBuilder.Entity<UserMsg>().HasData(
                new UserMsg
                {
                    Id = 1,
                    UserId = 1,
                    Gender = "男",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );

            //初始化商城信息
            modelBuilder.Entity<MallMsg>().HasData(
                new MallMsg
                {
                    Id = 1,
                    Name = "天狗商城",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );

            //初始化供货商
            modelBuilder.Entity<Supplier>().HasData(
                new Supplier
                {
                    Id = 1,
                    Name = "楼下小黑",
                    Msg = "我这里啥都有",
                    MerchantId = 1,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                },
                 new Supplier
                 {
                     Id = 2,
                     Name = "楼下小黑",
                     Msg = "我这里啥都有",
                     MerchantId = 4,
                     IsActived = true,
                     IsDeleted = false,
                     CreatedTime = currentData,
                     UpdatedTime = currentData,
                     Remarks = "种子数据"
                 },
                new Supplier
                {
                    Id = 3,
                    Name = "国务院军火库",
                    Msg = "这里很私密，你最好不要打听",
                    MerchantId = 3,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                },
                 new Supplier
                 {
                     Id = 4,
                     Name = "北京电子商品最大供货库",
                     Msg = "来北京，打电话",
                     MerchantId = 2,
                     IsActived = true,
                     IsDeleted = false,
                     CreatedTime = currentData,
                     UpdatedTime = currentData,
                     Remarks = "种子数据"
                 }

            );

            //初始化商家
            modelBuilder.Entity<Merchant>().HasData(
                new Merchant
                {
                    Id = 1,
                    Name = "航空母舰网购旗舰店",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                },
                 new Merchant
                 {
                     Id = 2,
                     Name = "高科技电子产品网购旗舰店",
                     IsActived = true,
                     IsDeleted = false,
                     CreatedTime = currentData,
                     UpdatedTime = currentData,
                     Remarks = "种子数据"
                 },
                  new Merchant
                  {
                      Id = 3,
                      Name = "全国最大进口飞机大炮网购店",
                      IsActived = true,
                      IsDeleted = false,
                      CreatedTime = currentData,
                      UpdatedTime = currentData,
                      Remarks = "种子数据"
                  },
                  new Merchant
                  {
                      Id = 4,
                      Name = "北京服装网购店",
                      IsActived = true,
                      IsDeleted = false,
                      CreatedTime = currentData,
                      UpdatedTime = currentData,
                      Remarks = "种子数据"
                  }

            );


            //初始化分类
            modelBuilder.Entity<Commodity_category>().HasData(
                new Commodity_category
                {
                    Id = 1,
                    Name = "军事武器",
                    GradeId = 1,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                },
                new Commodity_category
                {
                    Id = 2,
                    Name = "电子产品",
                    GradeId = 1,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                },
                 new Commodity_category
                 {
                     Id = 3,
                     Name = "手机",
                     GradeId = 2,
                     ParentCategoryId = 2,
                     IsActived = true,
                     IsDeleted = false,
                     CreatedTime = currentData,
                     UpdatedTime = currentData,
                     Remarks = "种子数据"
                 },
                new Commodity_category
                {
                    Id = 4,
                    Name = "服装鞋子",
                    GradeId = 1,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }
            );


            //初始化商品信息
            // modelBuilder.Entity<Merchandise>().HasData(
            //     new Merchandise
            //     {
            //         Id = 1,
            //         Name = "航空母舰",
            //         Commodity_categoryId = 1,
            //         DetailsId = 1,
            //         MerchantId = 1,
            //         Msg = "辽宁号超屌",
            //         IsActived = true,
            //         IsDeleted = false,
            //         CreatedTime = currentData,
            //         UpdatedTime = currentData,
            //         Remarks = "种子数据"
            //     },
            //     new Merchandise
            //     {
            //         Id = 2,
            //         Name = "huawei2022至尊版",
            //         Commodity_categoryId = 3,
            //         DetailsId = 2,
            //         MerchantId = 2,
            //         Msg = "你值得拥有",
            //         IsActived = true,
            //         IsDeleted = false,
            //         CreatedTime = currentData,
            //         UpdatedTime = currentData,
            //         Remarks = "种子数据"
            //     }

            // );

            // //初始化属性
            // modelBuilder.Entity<Attribute>().HasData(
            //     new Attribute
            //     {
            //         Id = 1,
            //         Name = "颜色",
            //         IsActived = true,
            //         IsDeleted = false,
            //         CreatedTime = currentData,
            //         UpdatedTime = currentData,
            //         Remarks = "种子数据"
            //     }

            // );

            // //初始化属性值
            // modelBuilder.Entity<Attribute_value>().HasData(
            //     new Attribute_value
            //     {
            //         Id = 1,
            //         Name = "黄色",
            //         IsActived = true,
            //         IsDeleted = false,
            //         CreatedTime = currentData,
            //         UpdatedTime = currentData,
            //         Remarks = "种子数据"
            //     }
            // );

            // //初始化规格
            // modelBuilder.Entity<Specifications>().HasData(
            //     new Specifications
            //     {
            //         Id = 1,
            //         MerchandiseId = 1,
            //         AttributeId = 1,
            //         Attribute_valueId = 1,
            //         Inventory = 2,
            //         Price = 992300,
            //         IsActived = true,
            //         IsDeleted = false,
            //         CreatedTime = currentData,
            //         UpdatedTime = currentData,
            //         Remarks = "种子数据"
            //     },
            //      new Specifications
            //      {
            //          Id = 2,
            //          MerchandiseId = 2,
            //          AttributeId = 1,
            //          Attribute_valueId = 1,
            //          Inventory = 99,
            //          Price = 5699,
            //          IsActived = true,
            //          IsDeleted = false,
            //          CreatedTime = currentData,
            //          UpdatedTime = currentData,
            //          Remarks = "种子数据"
            //      }

            // );


            // //初始化商品详情
            // modelBuilder.Entity<Details>().HasData(
            //     new Details
            //     {
            //         Id = 1,
            //         Word = "这是去过伊拉克战争的航空母舰，很顶",
            //         IsActived = true,
            //         IsDeleted = false,
            //         CreatedTime = currentData,
            //         UpdatedTime = currentData,
            //         Remarks = "种子数据"
            //     },
            //       new Details
            //       {
            //           Id = 2,
            //           Word = "好手机就选华为",
            //           IsActived = true,
            //           IsDeleted = false,
            //           CreatedTime = currentData,
            //           UpdatedTime = currentData,
            //           Remarks = "种子数据"
            //       }


            // );



        }

    }
}